define(function (require, exports, module) {
    'use strict';
    var Backbone = require('backbone'),
        _ = require('underscore'),
        utils = require('js/utils/tools'),
        helper = require('js/utils/router'),
        path = 'js/apps/stats/',
        config = {
            'account': {},
            'transaction': {},
            'activity': {
                order: '-created_at'
            },
            'order': {
                order: '-created_at'
            },
            'pay': {
                order: '-created_at'
            },
            'uninstall': {
                order: '-remove_at'
            },
            'feedback': {
                order: '-created_at'
            },
            'account_login': {
                order: '-created_at'
            },
            'recharge_order': {
                order: '-created_at'
            }
        };

    _.each(config, function (v, k) {
        v.noDetail = true;
    });
    exports.Router = Backbone.Router.extend({
        routes: {
            "stats/:key/(?*qs)": "statsList",
        },
        opList: function (key, qs) {
            helper.commonList(key, qs, path, config);
        },
        initialize: function () {
            require([path + 'account'], function (view) {
                _.each(view.Views, function (cls) {
                    utils.loadTemplate(cls);
                });
            });
        },
        statsList: function (key, qs) {
            helper.commonList(key, qs, path, config);
        },
    });
});
